/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.app.model;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author haolw
 * @time 2017/08/11
 */
public class MenuItem {
	private Integer id;
	private Integer parentId;
	private String name;
	private String url;
	private List<MenuItem> subMenus;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getParentId() {
		return parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public List<MenuItem> getSubMenus() {
		return subMenus;
	}

	public void setSubMenus(List<MenuItem> subMenus) {
		this.subMenus = subMenus;
	}

	public void addSubMenu(MenuItem subMenu) {
		if (subMenus == null) {
			subMenus = new ArrayList<MenuItem>();
		}
		subMenus.add(subMenu);
	}

}
